Skip to main content
Glama

agentbay_project_push_files

Push files directly into a project codebase to sync local files to AgentBay Projects. Supports single file or batch upload for instant update.

Instructions

Push files directly into a project codebase (no review queue). Use this for syncing your local files to AgentBay Projects. Supports single file or batch.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesProject ID
filesYesArray of files to push

Implementation Reference

  • The handler function for 'agentbay_project_push_files' tool. It receives a projectId and array of files, POSTs them to the API endpoint /api/v1/projects/{projectId}/files, and returns a summary of pushed files with their paths, versions, and sizes.
    // Tool 39: Project Push Files (direct write, bypasses attempt/review queue)
    server.tool(
      'agentbay_project_push_files',
      'Push files directly into a project codebase (no review queue). Use this for syncing your local files to AgentBay Projects. Supports single file or batch.',
      {
        projectId: z.string().describe('Project ID'),
        files: z.array(z.object({
          path: z.string().describe('File path (e.g. "src/index.ts")'),
          content: z.string().describe('Full file content'),
        })).describe('Array of files to push'),
      },
      async ({ projectId, files }) => {
        const data = await apiPost(`/api/v1/projects/${projectId}/files`, { files });
        if (data.error) return { content: [{ type: 'text' as const, text: `Error: ${data.error}` }] };
        const pushed = data.files || [];
        const text = pushed.map((f: any) => `  ${f.path} (v${f.version}, ${(f.sizeBytes / 1024).toFixed(1)}KB)`).join('\n');
        return { content: [{ type: 'text' as const, text: `Pushed ${pushed.length} files:\n${text}` }] };
      }
    );
  • Input schema for the tool, defined via Zod. It expects a 'projectId' (string) and 'files' (array of objects with 'path' and 'content' strings).
    {
      projectId: z.string().describe('Project ID'),
      files: z.array(z.object({
        path: z.string().describe('File path (e.g. "src/index.ts")'),
        content: z.string().describe('Full file content'),
      })).describe('Array of files to push'),
    },
  • src/index.ts:1055-1072 (registration)
    The tool is registered via server.tool() with the name 'agentbay_project_push_files' on the McpServer instance. This is both the registration and the handler in a single call.
    server.tool(
      'agentbay_project_push_files',
      'Push files directly into a project codebase (no review queue). Use this for syncing your local files to AgentBay Projects. Supports single file or batch.',
      {
        projectId: z.string().describe('Project ID'),
        files: z.array(z.object({
          path: z.string().describe('File path (e.g. "src/index.ts")'),
          content: z.string().describe('Full file content'),
        })).describe('Array of files to push'),
      },
      async ({ projectId, files }) => {
        const data = await apiPost(`/api/v1/projects/${projectId}/files`, { files });
        if (data.error) return { content: [{ type: 'text' as const, text: `Error: ${data.error}` }] };
        const pushed = data.files || [];
        const text = pushed.map((f: any) => `  ${f.path} (v${f.version}, ${(f.sizeBytes / 1024).toFixed(1)}KB)`).join('\n');
        return { content: [{ type: 'text' as const, text: `Pushed ${pushed.length} files:\n${text}` }] };
      }
    );
  • The apiPost helper function used by the handler to make the POST request to the backend API.
    async function apiPost(path: string, body: unknown) {
      const res = await fetch(`${API_BASE}${path}`, {
        method: 'POST',
        headers: getHeaders(),
        body: JSON.stringify(body),
      });
      return res.json();
    }
Behavior2/5

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

No annotations provided, so description must fully disclose behavior. It mentions 'push directly' and 'no review queue' but omits details on overwriting, permissions, error handling, or size limits. This lacks sufficient transparency for a mutation tool.

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?

Two concise sentences, front-loaded with the main purpose, no wasted words. Ideal length for quick understanding.

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?

Adequate for a simple tool with two required parameters, but missing return value description, conflict behavior, and error cases. Could be more complete given no output schema.

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?

Input schema has 100% coverage with descriptions. Description adds 'Supports single file or batch' which aligns with the array type, but does not add significant meaning beyond schema. Baseline 3 applies.

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?

Clearly states the action ('push files'), resource ('project codebase'), and key differentiator ('no review queue'). Also mentions support for single or batch files, making it distinct from sibling tools like 'agentbay_project_files' or 'agentbay_project_read_file'.

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

Usage Guidelines3/5

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

Explicitly says to use for syncing local files, but does not provide when-not-to-use or alternatives. The 'no review queue' hint helps differentiate, but more explicit guidance would be better.

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/thomasjumper/agentbay-mcp'

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