Skip to main content
Glama

submit_and_pay_job

Full customer flow: submit job -> auto-pay -> wait for result. Validates that the payment recipient matches the provider card.

Instructions

Full customer flow: submit job -> auto-pay -> wait for result. Validates that the payment recipient matches the provider card. If payment succeeded but no result arrives within the wait window, this returns a non-error "still processing" notice with the event ID (NOT a failure) - re-poll get_job_result later (results persist on the relays; for long jobs, poll periodically, e.g. from a subagent). Handles both free and paid providers automatically. If max_price_lamports is not set and the capability is paid, this returns the advertised price for confirmation WITHOUT submitting a job - re-call with max_price_lamports set to approve payments up to that limit (this is a confirmation, not an error). COST: input is sent inline in the tool call, so a large input pays output tokens on the calling LLM. For files or git diffs, prefer submit_and_pay_job_from_file or submit_diff_review respectively. This pays the listed price up front; when the capability advertises delegation, submit_delegated_job bills a metered card for actual usage instead.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "input": "<input>",
      "provider_npub": "<provider_npub>"
    },
    "name": "submit_and_pay_job"
  }
}

Input Schema

NameRequiredDescriptionDefault
inputYes
capabilityNogeneral
session_idNoConversation control. Omit for automatic session management (providers advertising context support get a conversation auto-started on first contact; an ongoing conversation triggers a continue/new/one-off question before anything is published). Pass "new" to force a fresh conversation, "none" to force a stateless one-off, or a session_id from a previous result to continue that conversation. The provider answers with the conversation context of prior exchanges under the same id.
kind_offsetNo
timeout_secsNo
provider_npubYes
max_price_lamportsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.1.60
    • addedInput schema / properties / max_price_lamports / maximum
      Added value: +9007199254740991
    • addedInput schema / properties / max_price_lamports / minimum
      Added value: +-9007199254740991
  2. Changed1 schema field changedv0.1.42
    • addedInput schema / properties / session_id
      Added value: +{
      +  "anyOf": [
      +    {
      +      "const": "new",
      +      "type": "string"
      +    },
      +    {
      +      "const": "none",
      +      "type": "string"
      +    },
      +    {
      +      "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
      +      "type": "string"
      +    }
      +  ],
      +  "description": "Conversation control. Omit for automatic session management (providers advertising context support get a conversation auto-started on first contact; an ongoing conversation triggers a continue/new/one-off question before anything is published). Pass \"new\" to force a fresh conversation, \"none\" to force a stateless one-off, or a session_id from a previous result to continue that conversation. The provider answers with the conversation context of prior exchanges under the same id."
      +}
  3. Addedv0.1.37
  4. Removedv0.1.36
  5. First observedv0.1.0

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations supplied, the description carries the full burden and does so: it discloses recipient-vs-provider card validation, the up-front charge model versus metered delegation billing, the non-error 'still processing' outcome with an event ID, result persistence on relays, and the quote-without-submitting path when max_price_lamports is omitted. These are exactly the behaviors an agent could otherwise misinterpret as failures.

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?

Front-loaded with the flow, then the two non-obvious outcomes, then cost and alternatives; every paragraph addresses a decision an agent must make. It is long and parenthetical-heavy, but dense rather than padded.

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 7-parameter mutation/payment tool with no annotations and no output schema, the description covers the high-risk behaviors: pricing confirmation, payment approval, delayed results, and re-polling. What is missing is the shape of a successful return (job ID, payment receipt) and the failure mode when the payee check fails, though the sibling get_job_result implies the follow-up path.

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 only 14% across 7 parameters, and the description compensates well for max_price_lamports (confirmation/approval semantics) and input (inline cost implication, and the fact that it is required). But session_id behavior is only in the schema, and kind_offset, timeout_secs, and provider_npub carry no explanation anywhere in the description, leaving real gaps for a low-coverage schema.

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?

States a specific composite verb flow ('submit job -> auto-pay -> wait for result') and immediately frames the alternatives: files go to submit_and_pay_job_from_file, diffs to submit_diff_review, delegation to submit_delegated_job. An agent can place this tool among its siblings without opening a schema.

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

Usage Guidelines5/5

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

Gives explicit when-to-use and when-not-to-use guidance: prefer the from_file / diff_review variants for large inputs, prefer submit_delegated_job when the capability advertises delegation, and re-poll get_job_result when a 'still processing' notice comes back. The max_price_lamports confirmation path is described as a normal step rather than an error, which steers correct retry behavior.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.