Skip to main content
Glama
funwarioisii

Cosense MCP Server

by funwarioisii

get_page

Retrieve a page from Cosense projects to access documents with titles, descriptions, and interlinked content using bracket notation.

Instructions

    Get a page from my-project project on cosen.se

    In cosense, a page is a cosense-style document with a title and a description.
    Bracket Notation makes links between pages.
    Example: [Page Title]
    -> "/my-project/Page Title"

    A page may have links to other pages.
    Links are rendered at the bottom of the page.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageTitleYesTitle of the page

Implementation Reference

  • Handler for the 'get_page' tool in the CallToolRequestSchema. Extracts pageTitle from arguments, fetches the page using getPage helper, formats it, and returns text content.
    case "get_page": {
      const pageTitle = String(request.params.arguments?.pageTitle);
      const page = await getPage(projectName, pageTitle, cosenseSid);
      if (!page) {
        throw new Error(`Page ${pageTitle} not found`);
      }
      const readablePage = toReadablePage(page);
    
      return {
        content: [
          {
            type: "text",
            text: readablePage.description,
          },
        ],
      };
    }
  • Input schema definition for the 'get_page' tool, specifying pageTitle as required string.
    inputSchema: {
      type: "object",
      properties: {
        pageTitle: {
          type: "string",
          description: "Title of the page",
        },
      },
      required: ["pageTitle"],
    },
  • src/index.ts:87-110 (registration)
    Registration of the 'get_page' tool in the ListToolsRequestSchema response, including name, description, and input schema.
    {
      name: "get_page",
      description: `
      Get a page from ${projectName} project on cosen.se
    
      In cosense, a page is a cosense-style document with a title and a description.
      Bracket Notation makes links between pages.
      Example: [Page Title]
      -> "/${projectName}/Page Title"
    
      A page may have links to other pages.
      Links are rendered at the bottom of the page.
      `,
      inputSchema: {
        type: "object",
        properties: {
          pageTitle: {
            type: "string",
            description: "Title of the page",
          },
        },
        required: ["pageTitle"],
      },
    },
  • Helper function that performs the actual API fetch to retrieve page data from cosen.se.
    async function getPage(
      projectName: string,
      pageName: string,
      sid?: string,
    ): Promise<GetPageResponse | null> {
      const response = sid
        ? await fetch(`https://cosen.se/api/pages/${projectName}/${pageName}`, {
            headers: { Cookie: `connect.sid=${sid}` },
          }).catch(() => null)
        : await fetch(
            `https://cosen.se/api/pages/${projectName}/${pageName}`,
          ).catch(() => null);
    
      if (!response) {
        return null;
      }
      const page = await response.json();
      return page as GetPageResponse;
    }
  • Helper function to transform raw GetPageResponse into a readable format with title and description including content and links.
    function toReadablePage(page: GetPageResponse): {
      title: string;
      description: string;
    } {
      const titleAndDescription = `
    ${page.title}
    ---
    
    ${page.lines.map((line) => line.text).join("\n")}
    `;
    
      const relatedPages =
        page.links.length > 0
          ? `## 関連するページのタイトル
    ${page.links.join("\n")}
    `
          : "";
      return {
        title: page.title,
        description: titleAndDescription + "\n" + relatedPages,
      };
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. While it describes what a page is and mentions links between pages, it doesn't address key behavioral aspects: what happens if the page doesn't exist, whether authentication is required, what format the response takes, or any rate limits. The description focuses on conceptual information rather than operational behavior.

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 reasonably concise with 5 sentences that each add value. It starts with the core purpose, then explains what a page is, describes the linking system, provides an example, and mentions link rendering. While efficient, the conceptual explanations could be more tightly integrated with the tool's practical usage.

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?

For a tool with no annotations and no output schema, the description is incomplete. It explains the domain concept of pages and links but doesn't address critical operational aspects: what the tool returns, error conditions, authentication requirements, or how to handle missing pages. The conceptual background is useful but doesn't substitute for practical usage information.

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 the single 'pageTitle' parameter. The description adds some context about how page titles work in the system (bracket notation, link formatting), but doesn't provide additional parameter-specific guidance beyond what's in the schema. With high schema coverage, the baseline score of 3 is appropriate.

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: 'Get a page from my-project project on cosen.se' - a specific verb (get) and resource (page). It distinguishes from the sibling tool 'list_pages' by focusing on retrieving a single page rather than listing multiple pages. However, it doesn't explicitly contrast with the sibling tool in the description text itself.

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 explicit guidance on when to use this tool versus alternatives. While the existence of 'list_pages' as a sibling tool suggests this is for retrieving individual pages rather than listing them, the description doesn't mention this distinction or provide any context about prerequisites, error conditions, or when not to use this tool.

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

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