Skip to main content
Glama
ying-dao

YingDao RPA MCP Server

Official
by ying-dao

uploadFile

Upload a file to the YingDao RPA platform to enable automated task execution. Accepts txt, csv, and xlsx files with names up to 100 characters.

Instructions

该接口用于上传文件到RPA平台。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileNo文件内容
fileNameYes文件名,支持txt、csv、xlsx格式,长度不超过100字符

Implementation Reference

  • The actual uploadFile handler implementation. Validates filename length (max 100 chars), validates file type (txt, csv, xlsx), creates FormData with a Blob, and POSTs to /dispatch/v2/file/upload with a 10MB limit.
    async uploadFile(file: Buffer | string, fileName: string): Promise<FileUploadResponse> {
      // Validate filename length
      if (fileName.length > 100) {
        throw new Error(i18n.t('rpaService.error.fileNameTooLong'));
      }
    
      // Validate file type
      const allowedExtensions = ['txt', 'csv', 'xlsx'];
      const fileExtension = fileName.split('.').pop()?.toLowerCase();
      if (!fileExtension || !allowedExtensions.includes(fileExtension)) {
        throw new Error(i18n.t('rpaService.error.unsupportedFileType'));
      }
    
      // Create FormData and convert file to Blob
      const formData = new FormData();
      const blob = typeof file === 'string' ? new Blob([file]) : new Blob([file]);
      formData.append('file', blob, fileName);
    
      try {
        const response = await this.client.post('/dispatch/v2/file/upload', formData, {
          headers: {
            'Content-Type': 'multipart/form-data'
          },
          maxBodyLength: 10 * 1024 * 1024 // 10MB limit
        });
    
        if (response.data.code !== 200) {
          throw new Error(response.data.msg || i18n.t('rpaService.error.uploadFailed'));
        }
    
        return response.data;
      } catch (error: any) {
        throw new Error(`${i18n.t('rpaService.error.uploadFailed')}: ${error.message}`);
      }
    }
  • Registers the 'uploadFile' MCP tool with its schema and handler callback. The tool is registered in the registerTools() method which runs when RPA_MODEL is not 'local'.
    this.server.tool('uploadFile', i18n.t('tool.uploadFile.description'), uploadFileSchema, async ({ file, fileName }) => {
        try {
            const result = await this.openApiService?.uploadFile(file, fileName);
            return { content: [{ type: 'text', text: JSON.stringify(result) }]};
        } catch (error) {
            throw new Error(i18n.t('tool.uploadFile.error'));
        }
    });
  • Zod schema for uploadFile tool input validation: 'file' (any type, file content) and 'fileName' (string, max 100 characters).
    export const uploadFileSchema = {
        file: z.any().describe(i18n.t('schema.uploadFile.file')),
        fileName: z.string().max(100).describe(i18n.t('schema.uploadFile.fileName'))
    } as const;
  • TypeScript type definition for the FileUploadResponse interface returned by the uploadFile API.
    interface FileUploadResponse {
      code: number;
      success: boolean;
      msg: string;
      data: {
        fileKey: string;
      };
    }
  • i18n translations for uploadFile tool description and error messages (English), plus schema field descriptions.
    translation: {
      // Tool descriptions
      'tool.uploadFile.description': 'This interface is used to upload files to the RPA platform.',
Behavior2/5

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

Description lacks behavioral details beyond basic upload. No info on side effects, file size limits, authentication, or what happens after upload. Ambiguity in 'file' parameter type.

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

Conciseness2/5

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

Single sentence, but under-specified. Missing critical details for a file upload tool.

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?

Incomplete for a file upload operation. No info on return values, error conditions, or integration with RPA platform.

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?

Schema covers both parameters with descriptions (100% coverage). Description adds no extra meaning beyond schema, so baseline 3 is appropriate.

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

Purpose4/5

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

Description clearly states the action (upload) and resource (file to RPA platform). Siblings are query tools, so differentiation is obvious but not explicitly stated.

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 on when to use this tool vs alternatives. No exclusions or context provided.

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/ying-dao/yingdao_mcp_server'

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