Skip to main content
Glama
shadowrootdev

Awesome Agent Skills MCP Server

invoke_skill

Run any AI agent skill by providing its ID and required parameters to receive structured instructions for specialized tasks.

Instructions

Invoke a skill with parameters to get formatted instructions

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
skill_idYesUnique identifier of the skill to invoke
parametersNoParameters to pass to the skill

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
successNo
contentNo
errorNo
executionTimeNo

Implementation Reference

  • The actual implementation of invoke_skill logic. Looks up the skill by ID from the registry, validates parameters via registry, substitutes {{param}} and ${param} placeholders with provided values, and returns the formatted content with execution time.
    async invokeSkill(skillId: string, parameters: Record<string, unknown> = {}): Promise<InvocationResult> {
      const startTime = Date.now();
    
      try {
        // Check if skill exists
        const skill = this.registry.getSkill(skillId);
        if (!skill) {
          const executionTime = Date.now() - startTime;
          logger.warn(`Skill not found: ${skillId}`);
          return createErrorResult('SkillNotFound', `Skill not found: ${skillId}`, executionTime);
        }
    
        // Validate parameters
        const validation = this.registry.validateParameters(skillId, parameters);
        if (!validation.valid) {
          const executionTime = Date.now() - startTime;
          const errorMessage = validation.errors?.join(', ') || 'Parameter validation failed';
          logger.warn(`Parameter validation failed for skill ${skillId}: ${errorMessage}`);
          return createErrorResult('InvalidParams', errorMessage, executionTime, { errors: validation.errors });
        }
    
        // Substitute parameters into skill content
        const formattedContent = this.substituteParameters(skill.content, parameters);
    
        const executionTime = Date.now() - startTime;
        logger.debug(`Skill ${skillId} invoked successfully in ${executionTime}ms`);
    
        return createSuccessResult(formattedContent, executionTime);
      } catch (error) {
        const executionTime = Date.now() - startTime;
        const errorMessage = error instanceof Error ? error.message : String(error);
        logger.error(`Error invoking skill ${skillId}:`, error);
        return createErrorResult('ExecutionError', errorMessage, executionTime);
      }
    }
  • InvocationResult schema (Zod) defining the output shape: success boolean, optional content string, optional error object (code, message, details), and executionTime number.
    export const invocationResultSchema = z.object({
      success: z.boolean(),
      content: z.string().optional(),
      error: invocationErrorSchema.optional(),
      executionTime: z.number().int().min(0),
    });
  • InvocationError schema (Zod) defining the error structure with code (enum of error types), message, and optional details.
    export const invocationErrorSchema = z.object({
      code: z.enum(['InvalidParams', 'SkillNotFound', 'ExecutionError', 'RepositoryError', 'InternalError']),
      message: z.string(),
      details: z.record(z.any()).optional(),
    });
  • src/server.ts:155-193 (registration)
    Registration of invoke_skill as an MCP tool: defines the tool name, description, inputSchema (skill_id required, parameters optional object), outputSchema, and annotations (readOnlyHint: false).
    {
      name: 'invoke_skill',
      description: 'Invoke a skill with parameters to get formatted instructions',
      inputSchema: {
        type: 'object',
        properties: {
          skill_id: {
            type: 'string',
            description: 'Unique identifier of the skill to invoke',
          },
          parameters: {
            type: 'object',
            description: 'Parameters to pass to the skill',
            additionalProperties: true,
          },
        },
        required: ['skill_id'],
      },
      outputSchema: {
        type: 'object',
        properties: {
          success: { type: 'boolean' },
          content: { type: 'string' },
          error: {
            type: 'object',
            properties: {
              code: { type: 'string' },
              message: { type: 'string' },
              details: { type: 'object' },
            },
          },
          executionTime: { type: 'number' },
        },
      },
      annotations: {
        readOnlyHint: false,
        openWorldHint: false,
      },
    },
  • Handler in the CallToolRequestSchema switch-case that extracts skill_id and parameters from args, validates skill_id presence, delegates to executor.invokeSkill(), and returns the result.
    case 'invoke_skill': {
      const skillId = args?.skill_id as string;
      const parameters = (args?.parameters as Record<string, unknown>) || {};
    
      if (!skillId) {
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({
                success: false,
                error: {
                  code: 'InvalidParams',
                  message: 'Missing required parameter: skill_id',
                },
              }),
            },
          ],
          isError: true,
        };
      }
    
      const result = await this.executor.invokeSkill(skillId, parameters);
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result),
          },
        ],
        isError: !result.success,
      };
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the annotations indicating it is not read-only, the description adds minimal behavioral context. It does not explain side effects, state changes, or any constraints (e.g., rate limits, required permissions).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence with no unnecessary words, front-loading the key action and resource. Every part earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the presence of an output schema, the description does not need to explain return values. However, it lacks context on error conditions, parameter validation, and prerequisites, making it minimally complete for a simple invocation tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage for both parameters. The description adds no additional meaning beyond what the schema provides, so it meets the baseline but does not enhance understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'invoke' and resource 'skill', and specifies the outcome 'get formatted instructions'. This distinguishes it from siblings like 'get_skill' and 'list_skills'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is given on when to use this tool versus alternatives. There is no mention of prerequisites, exclusions, or typical use cases, leaving the agent to infer context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/shadowrootdev/awesome-agent-skills-mcp'

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