Skip to main content
Glama

create_pokepaste

Generate shareable Pokepaste URLs from Pokémon team data to format and share competitive teams via a simple API.

Instructions

Create a Pokepaste from Pokemon set data

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pokemonYesArray of Pokemon set objects
titleNoOptional title for the paste
authorNoOptional author name
notesNoOptional notes

Implementation Reference

  • The core handler function that converts Pokemon sets to Pokepaste text format using Sets.exportSet, posts it to pokepast.es/create via fetch, handles the 303 redirect to get the paste URL, and returns it or throws an error.
    async function createPokepaste(pokemonSets: any[], title?: string, author?: string, notes?: string): Promise<string> {
      const pokemonStrings = pokemonSets.map(set => Sets.exportSet(set));
      const pasteContent = pokemonStrings.join('\n\n');
      
      const formData = new URLSearchParams();
      formData.append('paste', pasteContent);
      
      if (title) formData.append('title', title);
      if (author) formData.append('author', author);
      if (notes) formData.append('notes', notes);
    
      const response = await fetch('https://pokepast.es/create', {
        method: 'POST',
        headers: {
          'Content-Type': 'application/x-www-form-urlencoded',
        },
        body: formData,
        redirect: 'manual'
      });
    
      if (response.status === 303) {
        const location = response.headers.get('location');
        if (location) {
          return `https://pokepast.es${location}`;
        }
      }
      
      throw new Error(`Failed to create pokepaste: ${response.status} ${response.statusText}`);
    }
  • Zod schema for validating the input arguments to the create_pokepaste tool, including array of PokemonSetSchema objects and optional title, author, notes.
    const CreatePokepasteSchema = z.object({
      pokemon: z.array(PokemonSetSchema),
      title: z.string().optional(),
      author: z.string().optional(),
      notes: z.string().optional(),
    });
  • Detailed Zod schema defining a Pokemon set object, used within CreatePokepasteSchema, including all fields like moves, evs, ivs, etc.
    const PokemonSetSchema = z.object({
      name: z.string(),
      species: z.string(),
      item: z.string(),
      ability: z.string(),
      moves: z.array(z.string()),
      nature: z.string(),
      gender: z.string(),
      evs: StatsTableSchema,
      ivs: StatsTableSchema,
      level: z.number(),
      shiny: z.boolean().optional(),
      happiness: z.number().optional(),
      pokeball: z.string().optional(),
      hpType: z.string().optional(),
      dynamaxLevel: z.number().optional(),
      gigantamax: z.boolean().optional(),
      teraType: z.string().optional(),
    });
  • src/index.ts:95-162 (registration)
    Tool registration in ListTools response, defining name, description, and detailed JSON inputSchema matching the Zod schema.
    {
      name: "create_pokepaste",
      description: "Create a Pokepaste from Pokemon set data",
      inputSchema: {
        type: "object",
        properties: {
          pokemon: {
            type: "array",
            description: "Array of Pokemon set objects",
            items: {
              type: "object",
              properties: {
                name: { type: "string", description: "Pokemon nickname" },
                species: { type: "string", description: "Pokemon species" },
                item: { type: "string", description: "Held item" },
                ability: { type: "string", description: "Pokemon ability" },
                moves: { 
                  type: "array", 
                  items: { type: "string" },
                  description: "Array of move names"
                },
                nature: { type: "string", description: "Pokemon nature" },
                gender: { type: "string", description: "Pokemon gender (M/F/N)" },
                evs: {
                  type: "object",
                  description: "Effort Values",
                  properties: {
                    hp: { type: "number" },
                    atk: { type: "number" },
                    def: { type: "number" },
                    spa: { type: "number" },
                    spd: { type: "number" },
                    spe: { type: "number" }
                  },
                  required: ["hp", "atk", "def", "spa", "spd", "spe"]
                },
                ivs: {
                  type: "object",
                  description: "Individual Values",
                  properties: {
                    hp: { type: "number" },
                    atk: { type: "number" },
                    def: { type: "number" },
                    spa: { type: "number" },
                    spd: { type: "number" },
                    spe: { type: "number" }
                  },
                  required: ["hp", "atk", "def", "spa", "spd", "spe"]
                },
                level: { type: "number", description: "Pokemon level" },
                shiny: { type: "boolean", description: "Is shiny", default: false },
                happiness: { type: "number", description: "Pokemon happiness" },
                pokeball: { type: "string", description: "Pokeball type" },
                hpType: { type: "string", description: "Hidden Power type" },
                dynamaxLevel: { type: "number", description: "Dynamax level" },
                gigantamax: { type: "boolean", description: "Can Gigantamax" },
                teraType: { type: "string", description: "Tera type" }
              },
              required: ["name", "species", "item", "ability", "moves", "nature", "gender", "evs", "ivs", "level"]
            }
          },
          title: { type: "string", description: "Optional title for the paste" },
          author: { type: "string", description: "Optional author name" },
          notes: { type: "string", description: "Optional notes" }
        },
        required: ["pokemon"]
      }
    }
  • src/index.ts:170-199 (registration)
    Dispatch logic in CallToolRequestHandler that validates arguments using CreatePokepasteSchema, calls the createPokepaste handler, and returns success/error content.
    if (name === "create_pokepaste") {
      try {
        const validatedArgs = CreatePokepasteSchema.parse(args);
        const url = await createPokepaste(
          validatedArgs.pokemon,
          validatedArgs.title,
          validatedArgs.author,
          validatedArgs.notes
        );
        
        return {
          content: [
            {
              type: "text",
              text: `Successfully created Pokepaste: ${url}`
            }
          ]
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Error creating Pokepaste: ${error instanceof Error ? error.message : String(error)}`
            }
          ],
          isError: true
        };
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions 'create,' implying a write operation, but does not address permissions, side effects, rate limits, or output format. For a creation tool with zero annotation coverage, this is a significant gap in transparency.

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 that directly states the tool's purpose without unnecessary words. It is front-loaded and wastes no space, making it highly concise and well-structured.

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

Completeness2/5

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

Given the complexity of the input schema (with nested objects and many properties) and the absence of annotations and output schema, the description is insufficient. It does not explain behavioral aspects, usage context, or what the tool returns, leaving significant gaps for a creation tool.

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 description coverage is 100%, meaning all parameters are documented in the schema. The description does not add any additional meaning or context beyond what the schema provides, such as formatting rules or examples. Thus, it meets the baseline score of 3.

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 tool's purpose: 'Create a Pokepaste from Pokemon set data.' It specifies the verb 'create' and the resource 'Pokepaste,' making it clear what the tool does. However, without sibling tools for comparison, it cannot be distinguished from alternatives, preventing a score of 5.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives, prerequisites, or context for its application. It simply states what the tool does without indicating scenarios or constraints for its use.

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/jpbullalayao/pokemon-paste-mcp'

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