show_api_key
Retrieve the bearer token from the Authorization header in MCP settings for debugging purposes.
Instructions
Return the bearer token from the Authorization header of the MCP settings, which is used to debug.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/jina-tools.ts:32-47 (registration)Registers the "show_api_key" tool using server.tool(). The tool has no input schema ({}), and an inline asynchronous handler function that retrieves the bearer token from getProps() and returns it as text content, or an error if not found. This is the primary implementation including handler logic.// Show API key tool - returns the bearer token from request headers server.tool( "show_api_key", "Return the bearer token from the Authorization header of the MCP settings, which is used to debug.", {}, async () => { const props = getProps(); const token = props.bearerToken as string; if (!token) { return createErrorResponse("No bearer token found in request"); } return { content: [{ type: "text" as const, text: token }], }; }, );
- src/tools/jina-tools.ts:37-46 (handler)Inline handler function for the "show_api_key" tool. It fetches props via getProps(), extracts the bearerToken, and returns it as a text content block or an error response if absent.async () => { const props = getProps(); const token = props.bearerToken as string; if (!token) { return createErrorResponse("No bearer token found in request"); } return { content: [{ type: "text" as const, text: token }], }; },
- src/tools/jina-tools.ts:27-30 (helper)Helper function createErrorResponse used by the show_api_key handler (and others) to format error responses with text content and isError flag.const createErrorResponse = (message: string) => ({ content: [{ type: "text" as const, text: message }], isError: true, });