Skip to main content
Glama

verify_token

Validate JWT tokens to authenticate users and secure access to JSON database operations, ensuring only authorized interactions with project tracking, user management, and analytics features.

Instructions

JWT token'ın geçerliliğini kontrol eder

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tokenYesJWT token

Implementation Reference

  • The execution handler for the 'verify_token' tool within the CallToolRequestSchema switch statement. It extracts the token from arguments, calls verifyToken helper, and returns success with decoded user data or error message.
    case 'verify_token': { const { token } = args; try { const decoded = verifyToken(token); return { content: [{ type: 'text', text: JSON.stringify({ success: true, message: 'Token geçerli', user: decoded }) }] }; } catch (error) { return { content: [{ type: 'text', text: JSON.stringify({ success: false, message: error.message }) }] }; } }
  • src/index.js:97-106 (registration)
    Registration of the 'verify_token' tool in the tools list returned by ListToolsRequestHandler, including name, description, and input schema definition.
    name: 'verify_token', description: 'JWT token\'ın geçerliliğini kontrol eder', inputSchema: { type: 'object', properties: { token: { type: 'string', description: 'JWT token' } }, required: ['token'] } },
  • Input schema definition for the 'verify_token' tool, specifying the required 'token' string parameter.
    inputSchema: { type: 'object', properties: { token: { type: 'string', description: 'JWT token' } }, required: ['token']
  • Helper function verifyToken that performs the core JWT token verification using jsonwebtoken.verify and throws an error on invalid tokens.
    export function verifyToken(token) { try { return jwt.verify(token, JWT_SECRET); } catch (error) { throw new Error('Geçersiz token'); } }

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/yusuferenkt/mcp-database'

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