get_document_id_from_title
Retrieve document IDs from Outline wiki using document titles to enable document management and search operations.
Instructions
Find document ID by title.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| collectionId | No |
Implementation Reference
- src/lib/handlers/search.ts:38-54 (handler)The core handler function implementing the get_document_id_from_title tool. It searches Outline API for documents matching the title query within optional collection, filters exact title matches, and returns document IDs, 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 input schema for get_document_id_from_title tool, defining required 'query' string and optional 'collectionId'.export const getDocumentIdFromTitleSchema = z.object({ query: z.string().min(1, 'Query is required'), collectionId: collectionId.optional(), });
- src/lib/tools.ts:41-45 (registration)Tool registration in the allTools list, specifying name, description, and schema key for MCP tool definition.createTool( 'get_document_id_from_title', 'Find document ID by title.', 'get_document_id_from_title' ),
- src/lib/schemas.ts:172-172 (schema)TypeScript type derived from the schema for use in handler signatures.export type GetDocumentIdFromTitleInput = z.infer<typeof getDocumentIdFromTitleSchema>;
- src/lib/schemas.ts:214-214 (registration)Association of tool name to its schema in the central toolSchemas map.get_document_id_from_title: getDocumentIdFromTitleSchema,