Skip to main content
Glama

collection_get

Retrieve complete details of a saved HTTP request by its name for API testing and collection management.

Instructions

Obtiene los detalles completos de un request guardado por su nombre.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesNombre del request guardado

Implementation Reference

  • The handler for collection_get: takes a 'name' string parameter, calls storage.getCollection(name) to retrieve the saved request, returns JSON-stringified details on success, or an error message if not found.
    // ── collection_get ──
    server.tool(
      'collection_get',
      'Obtiene los detalles completos de un request guardado por su nombre.',
      {
        name: z.string().describe('Nombre del request guardado'),
      },
      async (params) => {
        try {
          const saved = await storage.getCollection(params.name)
    
          if (!saved) {
            return {
              content: [
                {
                  type: 'text' as const,
                  text: `Request '${params.name}' no encontrado`,
                },
              ],
              isError: true,
            }
          }
    
          return {
            content: [
              {
                type: 'text' as const,
                text: JSON.stringify(saved, null, 2),
              },
            ],
          }
        } catch (error) {
          const message = error instanceof Error ? error.message : String(error)
          return {
            content: [{ type: 'text' as const, text: `Error: ${message}` }],
            isError: true,
          }
        }
      },
    )
  • Input schema for collection_get: a single 'name' string parameter describing the saved request name.
    {
      name: z.string().describe('Nombre del request guardado'),
    },
  • Registration of collection_get tool via server.tool() with name 'collection_get' and description.
    server.tool(
      'collection_get',
      'Obtiene los detalles completos de un request guardado por su nombre.',
      {
        name: z.string().describe('Nombre del request guardado'),
      },
      async (params) => {
        try {
          const saved = await storage.getCollection(params.name)
    
          if (!saved) {
            return {
              content: [
                {
                  type: 'text' as const,
                  text: `Request '${params.name}' no encontrado`,
                },
              ],
              isError: true,
            }
          }
    
          return {
            content: [
              {
                type: 'text' as const,
                text: JSON.stringify(saved, null, 2),
              },
            ],
          }
        } catch (error) {
          const message = error instanceof Error ? error.message : String(error)
          return {
            content: [{ type: 'text' as const, text: `Error: ${message}` }],
            isError: true,
          }
        }
      },
    )
  • The storage helper method that reads a saved request from the filesystem by sanitizing the name and reading the JSON file from the collections directory.
    async getCollection(name: string): Promise<SavedRequest | null> {
      const filePath = join(this.collectionsDir, `${this.sanitizeName(name)}.json`)
      return this.readJson<SavedRequest>(filePath)
    }
Behavior3/5

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

No annotations are provided, so the description must carry the burden. It states 'detalles completos' (complete details) but does not explicitly mention read-only nature, side effects, or authentication needs. Annotations would have helped, but the description is minimally adequate.

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?

Single sentence with no unnecessary words, efficiently conveying the core action and resource.

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 retrieval tool with one parameter and no output schema, the description is mostly complete. However, it does not specify the format of the details returned or any limitations, leaving minor gaps.

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?

The schema covers 100% of parameters with a clear description for 'name'. The tool description adds that it retrieves 'complete details,' which provides additional context beyond the schema's param description. Baseline score is appropriate.

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 clear verb ('Obtiene' meaning 'gets') and specific resource ('detalles completos de un request guardado'), distinguishing it from sibling tools like collection_list (lists all collections) and collection_save (saves collections).

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?

No explicit guidance on when to use this tool versus alternatives. The description only implies usage for retrieving saved request details without providing context or exclusions.

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/cocaxcode/api-testing-mcp'

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