# Get Content Details

## User Intent

"I want to retrieve full details for a specific content item"

## Operation

* **SDK Method**: `graphlit.getContent()`
* **GraphQL**: `getContent` query
* **Entity Type**: Content
* **Common Use Cases**: View content details, access extracted markdown, check metadata

## TypeScript (Canonical)

```typescript
import { Graphlit } from 'graphlit-client';
import { ContentTypes, EntityState, FileTypes } from 'graphlit-client/dist/generated/graphql-types';

const graphlit = new Graphlit();

// Content IDs are GUIDs (e.g., '550e8400-e29b-41d4-a716-446655440000')
const contentId = 'content-id-here';

// Get full content details
const content = await graphlit.getContent(contentId);

console.log(`\nContent: ${content.content.name}`);
console.log(`Type: ${content.content.type}`);
console.log(`State: ${content.content.state}`);
console.log(`Created: ${content.content.creationDate}`);

// Access extracted text
if (content.content.markdown) {
  console.log(`\nExtracted text (first 500 chars):`);
  console.log(content.content.markdown.substring(0, 500));
}

// Check file details
if (content.content.fileType) {
  console.log(`\nFile Type: ${content.content.fileType}`);
  console.log(`File Size: ${content.content.fileSize} bytes`);
}

// Access URI
if (content.content.uri) {
  console.log(`URI: ${content.content.uri}`);
}
```

## Parameters

* **`id`** (string): Content ID

## Response

```typescript
{
  content: {
    id: string;
    name: string;
    type: ContentTypes;
    state: EntityState;
    creationDate: Date;
    markdown?: string;
    summary?: string;
    uri?: string;
    fileType?: FileTypes;
    fileSize?: number;
    // Many more fields...
  }
}
```

## Developer Hints

### Access Extracted Content

```typescript
const content = await graphlit.getContent(contentId);

// Full extracted markdown
console.log(content.content.markdown);

// Auto-generated summary
console.log(content.content.summary);

// Custom summary (if set)
console.log(content.content.customSummary);
```

### Check Processing State

```typescript
const content = await graphlit.getContent(contentId);

if (content.content.state === EntityState.Finished) {
  console.log(' Processing complete');
} else {
  console.log('⏳ Still processing');
}
```

## Variations

### 1. Basic Content Retrieval

```typescript
const content = await graphlit.getContent(contentId);
console.log(content.content.name);
```

### 2. Get Extracted Text

```typescript
const content = await graphlit.getContent(contentId);
const markdown = content.content.markdown;
console.log(markdown);
```

### 3. Check File Details

```typescript
const content = await graphlit.getContent(contentId);
console.log(`File: ${content.content.fileType}`);
console.log(`Size: ${content.content.fileSize} bytes`);
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.graphlit.dev/api-guides/use-cases/content/content-get.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
