Template:Tool: Difference between revisions

From Public AI Wiki
No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<noinclude>
<noinclude>
Template for storing MCP tools using Cargo.
This template is used to define a tool in the Public AI system.
 
{{#cargo_declare:
{{#cargo_declare:
_table = Tools
_table=Tools
|ToolName = String
|description=Text
|Description = Text
|tool_type=String
|RepoURL = URL
|has_resources=Boolean
|Author = String
}}
|ToolType = String
 
== Parameters ==
* '''name''' - Display name of the tool (defaults to page name)
* '''description''' - Brief description of what the tool does
* '''tool_type''' - Category of tool (e.g., "Crisis Support", "Transit", "Mapping")
* '''has_resources''' - Boolean indicating if tool has locale-specific resources
* '''overview''' - Detailed overview of the tool
* '''usage''' - How to use the tool
 
== Example ==
<pre>
{{Tool
|name=Suicide Hotline
|description=Crisis support hotlines by country
|tool_type=Crisis Support
|has_resources=true
|overview=Provides access to suicide prevention hotlines...
|usage=Query by country or region...
}}
}}
</pre>
<templatedata>
<templatedata>
{
{
   "description": "Registers an MCP tool in the shared tools database.",
   "description": "Registers a tool in the Public AI system.",
   "params": {
   "params": {
     "ToolName": {
     "name": {
       "label": "Tool name",
       "label": "Tool name",
       "type": "string",
       "type": "string",
       "required": true
       "description": "Display name (defaults to page name)"
     },
     },
     "Description": {
     "description": {
       "label": "Description",
       "label": "Description",
       "type": "string",
       "type": "string",
       "required": true
       "required": true
     },
     },
     "RepoURL": {
     "tool_type": {
       "label": "Repository URL",
       "label": "Tool type",
       "type": "string"
      "type": "string",
      "default": "General"
    },
    "has_resources": {
      "label": "Has resources",
       "type": "string",
      "default": "false"
     },
     },
     "Author": {
     "overview": {
       "label": "Author",
       "label": "Overview",
       "type": "string"
       "type": "content"
     },
     },
     "ToolType": {
     "usage": {
       "label": "Tool type",
       "label": "Usage instructions",
       "type": "string"
       "type": "content"
     }
     }
   }
   }
}
}
</templatedata>
</templatedata>
[[Category:Templates]]
</noinclude>
</noinclude>
<includeonly>
<includeonly>
<div style="border: 1px solid #ddd; padding: 15px; margin-bottom: 20px; border-radius: 5px; background-color: #f9f9f9;">
{| class="wikitable" style="float:right; margin-left:1em; width:300px;"
! colspan="2" style="text-align:center; font-size:larger;" | {{{name|{{PAGENAME}}}}}
|-
| '''Type:''' || {{{tool_type|General}}}
|-
| '''Description:''' || {{{description|}}}
|}


=== {{{ToolName|}}} ===
== Overview ==
{{{overview|}}}


'''{{{Description|}}}'''
== Resources ==
{{#cargo_query:
tables=ToolResources
|where=tool='{{PAGENAME}}'
|fields=_pageName=Resource,country,region
|format=ul
}}


{{#if:{{{RepoURL|}}}|* '''Repository:''' {{{RepoURL|}}}}}
== Usage ==
{{#if:{{{Author|}}}|* '''Author:''' {{{Author|}}}}}
{{{usage|}}}
{{#if:{{{ToolType|}}}|* '''Type:''' {{{ToolType|}}}}}


</div>
{{#cargo_store:
{{#cargo_store:
_table = Tools
_table=Tools
|ToolName = {{{ToolName|}}}
|description={{{description|}}}
|Description = {{{Description|}}}
|tool_type={{{tool_type|General}}}
|RepoURL = {{{RepoURL|}}}
|has_resources={{{has_resources|false}}}
|Author = {{{Author|}}}
|ToolType = {{{ToolType|}}}
}}
}}
</includeonly>

Latest revision as of 03:28, 23 December 2025

This template is used to define a tool in the Public AI system.

This template defines the table "Tools". View table.

Parameters[edit source]

  • name - Display name of the tool (defaults to page name)
  • description - Brief description of what the tool does
  • tool_type - Category of tool (e.g., "Crisis Support", "Transit", "Mapping")
  • has_resources - Boolean indicating if tool has locale-specific resources
  • overview - Detailed overview of the tool
  • usage - How to use the tool

Example[edit source]

{{Tool
|name=Suicide Hotline
|description=Crisis support hotlines by country
|tool_type=Crisis Support
|has_resources=true
|overview=Provides access to suicide prevention hotlines...
|usage=Query by country or region...
}}

Registers a tool in the Public AI system.

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
Tool namename

Display name (defaults to page name)

Stringoptional
Descriptiondescription

no description

Stringrequired
Tool typetool_type

no description

Default
General
Stringoptional
Has resourceshas_resources

no description

Default
false
Stringoptional
Overviewoverview

no description

Contentoptional
Usage instructionsusage

no description

Contentoptional