get_spec_info
Retrieve OpenAPI specification details including title, version, description, servers, security schemes, and tagged endpoint counts to understand API structure and capabilities.
Instructions
Get general information about the OpenAPI spec: title, version, description, servers, security schemes, and available tags with endpoint counts. Start here to understand an unfamiliar API. Then use list_endpoints_by_tag or search_endpoints to explore specific areas.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/get-spec-info.ts:3-25 (handler)The handler function that implements the get_spec_info tool logic. It extracts and returns general information about the OpenAPI spec including title, version, description, servers, tags with endpoint counts, and security schemes.
export function getSpecInfo(spec: ParsedSpec) { const result: Record<string, unknown> = { title: spec.info.title, version: spec.info.version, description: spec.info.description, servers: spec.info.servers, tags: spec.tags.map(t => ({ name: t.name, description: t.description, endpointCount: t.endpointCount, })), } if (spec.info.securitySchemes.length > 0) { result.securitySchemes = spec.info.securitySchemes } if (spec.info.security.length > 0) { result.security = spec.info.security } return result } - src/index.ts:86-95 (registration)Registration of the get_spec_info tool with the MCP server. Defines the tool name, description, and handler callback that invokes getSpecInfo and returns the JSON-formatted result.
server.registerTool( 'get_spec_info', { description: 'Get general information about the OpenAPI spec: title, version, description, servers, security schemes, and available tags with endpoint counts. Start here to understand an unfamiliar API. Then use list_endpoints_by_tag or search_endpoints to explore specific areas.', }, () => { const result = getSpecInfo(spec) return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] } }, ) - src/types.ts:76-82 (schema)Type definition for ParsedSpec, which is the input parameter type for the getSpecInfo handler function.
export interface ParsedSpec { info: SpecInfo tags: TagInfo[] endpointIndex: EndpointEntry[] schemas: Record<string, unknown> rawSpec: OpenAPIObject } - src/types.ts:12-19 (schema)Type definition for SpecInfo, which contains the core spec metadata that getSpecInfo extracts and returns.
export interface SpecInfo { title: string version: string description: string servers: string[] security: Record<string, string[]>[] securitySchemes: SecuritySchemeInfo[] } - src/types.ts:21-25 (schema)Type definition for TagInfo, which represents tag information returned by getSpecInfo with endpoint counts.
export interface TagInfo { name: string description: string endpointCount: number }