Skip to main content
Glama

decline_thread

Cancel or decline a conversation thread on the402.ai marketplace. Agents or providers can use this to stop ongoing service requests, with potential refunds if work hasn't begun.

Instructions

Cancel or decline a thread on the402.ai. Either the agent or provider can use this. If payment was made and work hasn't started, a refund may be issued. Requires API key.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
thread_idYesThe thread ID to decline/cancel
reasonNoOptional reason for declining

Implementation Reference

  • The `decline_thread` tool is defined here using `server.tool` in `src/tools/threads.ts`. It registers the tool with the MCP server, defines its schema, and implements the handler logic which makes a POST request to the `/v1/threads/{thread_id}/decline` endpoint.
    server.tool(
    	"decline_thread",
    	"Cancel or decline a thread on the402.ai. Either the agent or provider can use this. If payment was made and work hasn't started, a refund may be issued. Requires API key.",
    	{
    		thread_id: z.string().describe("The thread ID to decline/cancel"),
    		reason: z.string().optional().describe("Optional reason for declining"),
    	},
    	async ({ thread_id, reason }) => {
    		const body: Record<string, unknown> = {};
    		if (reason) body.reason = reason;
    		const result = await client.authPost(
    			`/v1/threads/${thread_id}/decline`,
    			body
    		);
    		return {
    			content: [
    				{ type: "text" as const, text: JSON.stringify(result, null, 2) },
    			],
    		};
    	}
    );
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It adds useful context about refund possibilities and API key requirements, which aren't in the schema. However, it lacks details on side effects (e.g., thread status changes), error conditions, or response format, leaving gaps 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.

Conciseness4/5

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

The description is appropriately sized with three sentences that each add value: action definition, user roles/refund context, and authentication requirement. It's front-loaded with the core purpose. Minor room for improvement in flow, but overall efficient.

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?

For a mutation tool with no annotations and no output schema, the description provides basic operational context (refunds, API key) but lacks completeness. It doesn't cover success/error responses, idempotency, or system state changes, which are important for an agent to use this tool correctly.

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 description coverage is 100%, so the schema already documents both parameters thoroughly. The description doesn't add any meaningful semantic details about the parameters beyond what's in the schema (e.g., format of thread_id, examples of reasons). Baseline 3 is appropriate as the schema does the heavy lifting.

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?

The description clearly states the action ('Cancel or decline') and resource ('a thread on the402.ai'), making the purpose evident. However, it doesn't explicitly differentiate this tool from potential siblings like 'delete_service' or 'update_service' that might also modify thread states, missing full sibling distinction.

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?

The description provides some implied context by stating 'Either the agent or provider can use this' and mentioning refund conditions, but it doesn't give explicit guidance on when to use this tool versus alternatives like 'accept_proposal' or 'send_message' for thread management. No clear when-not-to-use or alternative tool references are included.

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

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