graphql_schema_type
Retrieve documentation for specific GitHub GraphQL schema types to understand their structure and usage in API queries.
Instructions
A tool to query specific type documentation in GitHub GraphQL schema. You need to provide the type_name
Args:
type_name: Type name like SecurityAdvisoryConnection
Returns:
str: Documentation content
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type_name | Yes |
Implementation Reference
- github_graphql_api_mcp_server.py:93-102 (handler)The handler function for the 'graphql_schema_type' tool. Decorated with @mcp.tool() for registration. It retrieves the specified GraphQL type from the pre-loaded schema and uses print_type to generate its documentation string.
@mcp.tool() def graphql_schema_type(type_name: str): """A tool to query specific type documentation in GitHub GraphQL schema. You need to provide the type_name Args: type_name: Type name like `SecurityAdvisoryConnection` Returns: str: Documentation content """ type_1 = schema.get_type(type_name) return print_type(type_1) - Pre-loading the GitHub GraphQL schema from 'schema.docs.graphql' file, which is used by the tool to fetch type information.
schema = build_schema(schema_content) text = print_schema(schema)