Skip to main content
Glama

post

Add comments to GitHub issues and pull requests to provide feedback, answer questions, or contribute to discussions on open source projects.

Instructions

Post a comment on a GitHub issue or pull request.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesFull GitHub issue or PR URL to comment on
messageYesThe comment text to post

Implementation Reference

  • Implementation of the post tool, which posts a comment to a GitHub issue or PR.
    export async function runPost(options: PostOptions): Promise<PostOutput> {
      validateUrl(options.url);
      validateGitHubUrl(options.url, ISSUE_OR_PR_URL_PATTERN, 'issue or PR');
    
      if (!options.message.trim()) {
        throw new Error('No message provided');
      }
    
      validateMessage(options.message);
    
      const token = requireGitHubToken();
    
      // Parse URL
      const parsed = parseGitHubUrl(options.url);
      if (!parsed) {
        throw new Error('Invalid GitHub URL format');
      }
    
      const { owner, repo, number } = parsed;
      const octokit = getOctokit(token);
    
      const { data: comment } = await octokit.issues.createComment({
        owner,
        repo,
        issue_number: number,
        body: options.message,
      });
    
      return {
        commentUrl: comment.html_url,
        url: options.url,
      };
    }
  • Registration of the post tool in the MCP server.
    // 9. post — Post a comment
    server.registerTool(
      'post',
      {
        description: 'Post a comment on a GitHub issue or pull request.',
        inputSchema: {
          url: z.string().describe('Full GitHub issue or PR URL to comment on'),
          message: z.string().describe('The comment text to post'),
        },
        annotations: { readOnlyHint: false, destructiveHint: false },
      },
      wrapTool(runPost),
    );
Behavior3/5

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

The description is consistent with annotations (acknowledges write operation via 'Post', matching readOnlyHint:false), but adds minimal behavioral context beyond annotations. It does not disclose authentication requirements, rate limiting, or what constitutes a valid GitHub URL format.

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, efficient sentence with no filler words. The information density is high, front-loading the action and target immediately without redundant elaboration.

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

Completeness4/5

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

For a simple two-parameter mutation tool, the description adequately covers the essential operation. However, it could be improved by indicating whether the operation returns the created comment ID or simply a success status, given the lack of 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?

With 100% schema description coverage, the baseline is met. The description reinforces the parameter semantics by mapping 'message' to 'comment' and 'url' to 'GitHub issue or pull request', but does not add syntax details or examples beyond what the schema already provides.

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 uses a specific verb ('Post') with clear resource ('comment') and target ('GitHub issue or pull request'). It effectively distinguishes from the sibling tool 'comments' (likely a retrieval operation) by using the action verb 'Post' versus a noun form.

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?

While the description is clear about what the tool does, it provides no explicit guidance on when to use this versus siblings like 'comments' (which likely lists comments) or 'read'. The usage must be inferred from the verb tense and object.

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/costajohnt/oss-autopilot'

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