Skip to main content
Glama
hongaah

Swiftcode MCP Server

by hongaah

generate_sfc_template_client

Download Vue.js SFC template files for transforming lists in your current directory to streamline frontend component development.

Instructions

下载转换 sfc / vue 列表的模板文件当前目录下 / Download the transform sfc template files

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dirYesworkspace dir

Implementation Reference

  • Handler implementation for the 'generate_sfc_template_client' tool. Extracts 'dir' from arguments, calls createTemplate('template.js', '', dir) to generate the SFC template file in the workspace directory, and returns a success message or throws an MCP error on failure.
    case 'generate_sfc_template_client': {
      const { dir } = args
      // 直接使用导入的模板内容,写入到目标目录
      try {
        createTemplate('template.js', '', dir)
    
        return {
          content: [
            {
              type: 'text',
              text: `SFC template file created successfully at ${path.join(dir, 'template.js')}`,
            },
          ],
        }
      } catch (error) {
        console.error('Error while generating SFC template files:', error)
        throw new McpError(ErrorCode.InternalError, 'Failed to generate SFC template files', {
          code: ErrorCode.InternalError,
          message: `Failed to generate SFC template files: ${error instanceof Error ? error.message : 'Unknown error'}`,
        })
      }
    }
  • src/index.ts:37-50 (registration)
    Tool registration in the TOOLS array, defining the name, description, and input schema (requiring 'dir' parameter). This is used by the MCP server for listing tools.
    {
      name: 'generate_sfc_template_client',
      description: '下载转换 sfc / vue 列表的模板文件当前目录下 / Download the transform sfc template files',
      inputSchema: {
        type: 'object',
        properties: {
          dir: {
            type: 'string',
            description: 'workspace dir',
          },
        },
        required: ['dir'],
      },
    },
  • Input schema definition for the 'generate_sfc_template_client' tool, specifying an object with a required 'dir' string property.
    inputSchema: {
      type: 'object',
      properties: {
        dir: {
          type: 'string',
          description: 'workspace dir',
        },
      },
      required: ['dir'],
    },
  • src/index.ts:84-94 (registration)
    Prompt registration in the PROMPTS array for 'generate_sfc_template_client', which may be used alongside the tool.
    {
      name: 'generate_sfc_template_client',
      description: '下载 swiftcode 生成 sfc 的模板文件',
      arguments: [
        {
          name: 'template',
          description: '',
          required: false,
        },
      ],
    },
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions downloading files to the current directory, which implies a write operation, but doesn't specify what happens if files already exist, whether this requires specific permissions, or what the expected outcome is. For a tool that presumably creates files, this is inadequate behavioral context.

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

Conciseness3/5

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

The description is brief but suffers from redundancy (providing both Chinese and English versions saying essentially the same thing). While not excessively wordy, it's not optimally structured - the bilingual approach adds length without adding clarity. The information could be more efficiently presented in a single language with clearer intent.

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

Completeness2/5

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

For a tool with no annotations, no output schema, and sibling tools that suggest this is part of a code generation system, the description is insufficient. It doesn't explain what the templates contain, what 'transform sfc' means, or how this tool differs from generate_sfc_client. The user is left guessing about the tool's role in the broader context.

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 schema description coverage is 100%, with the single parameter 'dir' documented as 'workspace dir'. The description doesn't add any meaningful parameter semantics beyond what the schema already provides. It mentions '当前目录下' (current directory) which might imply something about the 'dir' parameter, but this is ambiguous rather than clarifying. The baseline of 3 is appropriate given complete schema coverage.

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

Purpose2/5

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

The description states '下载转换 sfc / vue 列表的模板文件当前目录下 / Download the transform sfc template files', which is tautological - it essentially restates the tool name 'generate_sfc_template_client' in different words. While it mentions downloading template files for SFC/Vue transformation, it doesn't specify what transformation occurs or what the templates are for, making the purpose vague rather than specific.

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?

The description provides no guidance on when to use this tool versus its siblings (generate_api_client, generate_sfc_client). There's no mention of prerequisites, alternative tools, or specific scenarios where this tool is appropriate versus others. The user must infer usage from the name alone.

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/hongaah/swiftcode-mcp-server'

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