get_document_id_from_title
Retrieve document IDs from Outline Wiki by searching with document titles, enabling efficient document management and reference.
Instructions
Find document ID by title.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"query": "<query>"
},
"name": "get_document_id_from_title"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| collectionId | No |
Implementation Reference
- src/lib/handlers/search.ts:38-54 (handler)The handler function that executes the tool logic: searches for documents using the provided query (title), filters results where the title matches the query case-insensitively, and returns matching document IDs with titles and URLs.
async get_document_id_from_title(args: GetDocumentIdFromTitleInput) { const { data } = await apiCall(() => apiClient.post<SearchResult[]>('/documents.search', { query: args.query, collectionId: args.collectionId, limit: 5, }) ); return (data || []) .filter((item) => item.document.title.toLowerCase().includes(args.query.toLowerCase())) .map((item) => ({ id: item.document.id, title: item.document.title, url: buildUrl(baseUrl, item.document.url), })); }, - src/lib/schemas.ts:28-31 (schema)Zod schema defining the input for the tool: requires a query string (title to search for), optionally scoped to a collection ID.
export const getDocumentIdFromTitleSchema = z.object({ query: z.string().min(1, 'Query is required'), collectionId: collectionId.optional(), }); - src/lib/tools.ts:41-45 (registration)Registration of the tool in the allTools array, converting the Zod schema to JSON schema for MCP tool definition.
createTool( 'get_document_id_from_title', 'Find document ID by title.', 'get_document_id_from_title' ),