Skip to main content
Glama

get_document_id_from_title

Retrieve document IDs from Outline wiki by searching with document titles, enabling efficient document management and access.

Instructions

Find document ID by title.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
collectionIdNo

Implementation Reference

  • The handler function that implements the tool logic: searches Outline API for documents matching the query title, filters by exact match, 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), })); },
  • Zod schema defining the input parameters: required 'query' string and optional 'collectionId' UUID.
    export const getDocumentIdFromTitleSchema = z.object({ query: z.string().min(1, 'Query is required'), collectionId: collectionId.optional(), });
  • src/lib/tools.ts:41-45 (registration)
    Registers the MCP tool definition, providing name, description, and linking to the Zod schema for JSON Schema conversion.
    createTool( 'get_document_id_from_title', 'Find document ID by title.', 'get_document_id_from_title' ),
  • Maps the tool name to its input schema in the central toolSchemas object used by tool definitions.
    get_document_id_from_title: getDocumentIdFromTitleSchema,
  • TypeScript type inferred from the schema for use in handler function signatures.
    export type GetDocumentIdFromTitleInput = z.infer<typeof getDocumentIdFromTitleSchema>;

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/huiseo/outline-smart-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server